"""
    序列化：将python转为json
"""
import json

data = {
    "数字": [1, 2, 3, 4, 5, 6, 7, -1, -2],
    "字符串": ["1", "2"],
    "布尔值": [True, False],
    "空值": None,
    "列表": [[1, 2, 3], [-1, -2, -3]],
    "字典": [{"a": 1}, {"b": 2, "c": 3}]
}
with open("data.json","w",encoding="utf-8") as f:
    s=json.dumps(data,ensure_ascii=False)
    f.write(s)
